package  com.songyl.patternLearn.ObserverPattern;

/**
 * 具体观察者
 */
public class PlayerA extends PlayerObserver{

    RegistryPlayer registryPlayer;

    public PlayerA(RegistryPlayer registryPlayer) {
        this.registryPlayer=registryPlayer;
        this.registryPlayer.registryObserver(this);
    }

    @Override
    void updateOBState() {
        //System.out.println("PlayerB 看到的画面");
        System.out.println("PlayerA 看到的画面:OB选手"+(this.registryPlayer.isAlive()?"活着":"死了"));
    }
}
